package com.glory.good_dark.adapter;

import android.net.Uri;
import android.text.TextUtils;
import android.widget.ImageView;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.glory.good_dark.R;

import java.io.File;
import java.util.List;

/**
 * FileName: ShowCheckImageListAdapter
 * Author: XJH
 * Date: 2020/7/28 14:24
 * Description:
 * History:
 */
public class ShowCheckImageListAdapter extends BaseQuickAdapter<String, BaseViewHolder> {

    public ShowCheckImageListAdapter(@Nullable List<String> data) {
        super(R.layout.adapter_check_image,data);
    }

    @Override
    protected void convert(BaseViewHolder helper, String item) {
        ImageView ivIcon = helper.getView(R.id.ivIcon);
        if (!TextUtils.isEmpty(item)) {
            ivIcon.setImageURI(Uri.fromFile(new File(item)));
        } else {
            ivIcon.setImageResource(R.drawable.img_add_ablum);
        }
    }
}
